-
Notifications
You must be signed in to change notification settings - Fork 8.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Dashboard] [Controls] Fix dashboard reset when initial state has no controls #159404
[Dashboard] [Controls] Fix dashboard reset when initial state has no controls #159404
Conversation
a685464
to
8353235
Compare
Pinging @elastic/kibana-presentation (Team:Presentation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix LGTM! Thanks for tackling this one. Code only review, but everything looks like it should work great.
💚 Build Succeeded
Metrics [docs]Async chunks
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @Heenawter |
…controls (elastic#159404) ## Summary Consider taking the following steps: 1. Create a new dashboard and save it 2. Add a control and, without saving, 3. Reset the changes to the dashboard ### Before Before this PR, we were not updating the control group input if the `lastSavedControlGroupInput` was `undefined` (which only happens when a dashboard has **never** been saved with any controls and/or edits to the control group settings) - this caused a problem when trying to reset a dashboard from having controls back to the state where `lastSavedControlGroupInput` was `undefined` because the **dashboard's** input would get updated as expected (i.e. the dashboard would think it no longer has any controls), but the control group's input wouldn't get updated (i.e. the control group would think it **still has** controls). Because of this discrepancy, the control would stick around until you refreshed the dashboard: https://github.com/elastic/kibana/assets/8698078/c9da58dc-3373-493d-9bba-5d2540c19560 ### After Now, after this PR, I fixed this by resetting back to the default control group input if `lastSavedControlGroupInput` is `undefined` on reset: https://github.com/elastic/kibana/assets/8698078/e41838e6-6dbe-47a1-bea7-28f20eddcf80 ### Checklist - [x] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
Summary
Consider taking the following steps:
Before
Before this PR, we were not updating the control group input if the
lastSavedControlGroupInput
wasundefined
(which only happens when a dashboard has never been saved with any controls and/or edits to the control group settings) - this caused a problem when trying to reset a dashboard from having controls back to the state wherelastSavedControlGroupInput
wasundefined
because the dashboard's input would get updated as expected (i.e. the dashboard would think it no longer has any controls), but the control group's input wouldn't get updated (i.e. the control group would think it still has controls).Because of this discrepancy, the control would stick around until you refreshed the dashboard:
Screen.Recording.2023-06-09.at.1.52.41.PM.mov
After
Now, after this PR, I fixed this by resetting back to the default control group input if
lastSavedControlGroupInput
isundefined
on reset:Screen.Recording.2023-06-09.at.1.55.12.PM.mov
Checklist
For maintainers